#ifndef __TTFInfoGetterH__
#define __TTFInfoGetterH__

#include <vector>
typedef std::vector<ENUMLOGFONTEX> CTTFInfoSet;

const long ACAD_DEFAULTSTYLENUMBER = 34L;
const long ACAD_BOLD = 0x02000000L;
const long ACAD_ITALIC = 0x01000000L;

/*-------------------------------------------------------------------------------------*//**
@author Denis Petrov

@description Helper class for getting information about TTFs
*//*--------------------------------------------------------------------------------------*/
class CTTFInfoGetter
{
public:
	CTTFInfoGetter();
	int fillFontsInfo(LPCTSTR pTypefaceName = NULL, BYTE charSet = DEFAULT_CHARSET, HDC hDC = NULL);

	int fontCount() const { return m_fontsInfo.size(); }
	const ENUMLOGFONTEX& fontInfo(int index) const { return m_fontsInfo.at(index); }

	int getFontFileName(char* fileName, char* fontName, long styleNumber = ACAD_DEFAULTSTYLENUMBER, HDC hDC = NULL);

	static CTTFInfoGetter& get() { return s_theGetter; }
	static long styleNumber(LONG weight, BYTE italic, BYTE pitchAndFamily);
	static void getFontParams(LONG& wight, BYTE& italic, BYTE& pitchAndFamily, long styleNumber);
protected:
	static CTTFInfoGetter s_theGetter;

	CTTFInfoSet m_fontsInfo;

	static int CALLBACK EnumProc(ENUMLOGFONTEX *pLogFont, 
		NEWTEXTMETRICEX *pTextMetric,
		DWORD fontType,
		LPARAM lParam);
};

/*-------------------------------------------------------------------------------------*//**
@author Denis Petrov

@description Returns 1 if font name was found by font file succesefully.
*//*--------------------------------------------------------------------------------------*/
int getTTFontNameByFile(char* fontName, char* fontFile);

#endif
